Static debugging of C programs: detection of pointer errors in recursive data structures
نویسنده
چکیده
The incorrect use of pointers is one of the most common source of bugs in imperative languages. In this context, any kind of static code checking capable of detecting potential bugs at compile time is welcome. This paper presents a static debugging technique for the detection of incorrect accesses to memory (dereferences of invalid pointers). The analysed language is a subset of C. The tool is based on a static analyser extended with assertions inserted in the body of the program. Assertions are of two kinds: static assertions automatically veriied by the analyser, dynamic assertions treated as assumptions by the analyser. The technique deals with dynamically allocated data structures and it is accurate enough to handle circular structures. D ebogage statique de programmes C: d etection des erreurs de pointeurs dans les structures de donn ees r ecursives R esum e : L'utilisation incorrecte de pointeurs est une des sources d'erreurs les plus r epandues dans les langages imp eratifs. Dans ce contexte, tout v eriicateur statique de code capable de d etecter des erreurs potentielles a la compilation est bienvenu. Cet article pr esente une technique de d ebogage statique pour la d etection d'acc es incorrects a la m emoire (d er ef erences de pointeurs invalides). Le langage consid er e est un sous-ensemble de C. L'outil est bas e sur un analyseur statique etendu par des assertions qui sont de deux types: les assertions statiques qui sont v erii ees automatiquement par l'analyseur. les assertions hypoth etiques qui sont trait ees comme des hypoth eses par l'analyseur. La technique prend en compte les structures de donn ees allou ees dynamiquement et elle est suusamment pr ecise pour traiter les structures circulaires. Mots-cl e : d ebogage statique, analyse statique, v eriication de programmes, pointeurs pendants, d ebogage par assertions, logique de Hoare Static debugging of C programs: detection of pointer errors in recursive data structures 3
منابع مشابه
A Static Analysis for Program Understanding and Debugging
This paper presents a static pointer analysis technique for a subset of C. The tool supports user-defined assertions inserted in the body of the program. Assertions are of two kinds: static assertions automatically verified by the analyser, and hypothetical assertions treated as assumptions by the analyser. The technique deals with recursive data structures and it is accurate enough to handle c...
متن کاملCompile-Time Debugging of C Programs Working on Trees
We exhibit a technique for automatically verifying the safety of simple C programs working on tree-shaped data structures. We do not consider the complete behavior of programs, but only attempt to verify that they respect the shape and integrity of the store. A verified program is guaranteed to preserve the tree-shapes of data structures, to avoid pointer errors such as NULL dereferences, leaki...
متن کاملMonitoring Data-Structure Evolution in Distributed Message-Passing Programs
Monitoring the evolution of data structures in parallel and distributed programs, is critical for debugging its aemantica and performance. However, the current state-ofart in tracking and presenting data-structure information on parallel and distributed environments is cumbersome and does not scale. In this paper we present a methodology and tool that automatically tracks memory bindings (not t...
متن کاملA Shape System and Loop Invariant Inference
Pointer programs remain a major challenge for program analysis and verification. Shape analysis can discover the shape invariants of data structures in the heap and detect errors about manipulating pointers in a program. This paper presents a shape analysis for linked list programs based on a new shape graph representation. Our shape graphs could describe unbounded data structures without loss ...
متن کاملProgram Validation by Symbolic and Reverse Execution
Program validation is one of the most crucial tasks during program development since programs should conform to programmers’ requirements.2 To this end, one is often required to formulate requirements into formal specifications and analyze a given program against these specifications until no error is detected; if an error is detected, its cause must be located and fixed. In this dissertation, ...
متن کامل